from fastapi import APIRouter, Query, Request, Depends
from utils.response import success, fail, tableinfo
from app.model import WorkModel
from utils.database import get_db
from sqlalchemy.orm import Session

workController = APIRouter()

@workController.get("/imagelist")
async def imagelist(cat:int = 0, db: Session = Depends(get_db)):
    imgList = WorkModel.get_image_list(db, {'cat_id':cat})
    
    return success("操作成功", imgList)
